<template>
  <basic-container isTab v-loading="loading" element-loading-text="数据加载中...">
    <el-tabs class="gap-tabs" v-model="activeName" @tab-click="handleClick">
      <el-tab-pane class="tab-pane" name="first">
        <span slot="label" title="运行监测">运行监测</span>
        <totalPanel />
      </el-tab-pane>
      <el-tab-pane class="tab-pane" name="second">
        <span slot="label" title="隔离点负责人及隔离情况动态">隔离点负责人及隔离情况动态</span>
        <Empty />
      </el-tab-pane>
    </el-tabs>
  </basic-container>
</template>

<script>
import { mapState } from 'vuex'
import totalPanel from './components/totalPanel'
export default {
  components: {
    totalPanel
  },
  data () {
    return {
      loading: false,
      activeName: "first",
      titleOne: "",
      titleTwo: "",
    }
  },
  computed: {
    ...mapState(['user']),
  },
  mounted () {
    this.user.needResetPassword && this.confirmResetPassword()
  },
  beforeRouteLeave (to, from, next) {
    !['/login', '/sys-manage/edit-password'].includes(to.path) && this.user.needResetPassword ? this.confirmResetPassword() : next();
  },
  methods: {
    handleClick (tab, event) {
      //tab.$children[0].getListData();
    },
    confirmResetPassword () {
      this.$confirm('您的密码为初始密码，根据信息安全要求，请修改为您自己定义的安全密码，并且记住修改后的密码。密码要求包含数字、大小写字母、特殊符号，修改后，请重新登录。', '提示', {
        confirmButtonText: '确定',
        type: 'warning',
        showClose: false,
        showCancelButton: false,
        closeOnClickModal: false
      }).then(() => {
        this.$router.push('/sys-manage/edit-password')
      });
    }
  },
}
</script>

<style lang='scss'>
.gap-tabs {
  background-color: #ffffff;
  .el-tabs__content {
    background-color: #000f48;
  }
  .el-tabs__header {
    margin-bottom: 10px;
  }
}
.el-tab-pane {
}
.tab-pane {
  padding: 0;
}
/deep/ .el-tabs__nav-scroll {
  padding-left: 20px;
}
.layout-wrapper {
  // .router-view {
  //   height: auto !important;
  // }
}
</style>
